﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Web.Mvc;
using Microsoft.Practices.Unity;

namespace Webshop20.MVC.Helper
{
    public class ControllerFactory : DefaultControllerFactory
    {

        private readonly IUnityContainer _container;

        public ControllerFactory(IUnityContainer container)
        {
            _container = container;
        }

        protected override IController GetControllerInstance(Type controllerType)
        {
            return _container.Resolve(controllerType) as IController;
        }
    }
}
